<template>
	<view>
		<u-popup mode="center" round="5" :show="kefushow" @close="closed" closeable>
			<view class="mainpadding" style="min-width: 600rpx;">
				<view class="flexcolumn">
					<view class="flexcenter">
						<u-icon name="server-man" color="#ff7200" size="28"></u-icon>
						<view class="titletext margin_left huang_text bold" style="font-size: 36rpx;">在线客服</view>
					</view>
					<view class="main_size bold hui_text margin_top1 textcenter">OUTLINE COSIOMER SERVICE</view>
					<view class="flexbetween pdl margin_top6" style="width: 100%;" @click="phone(systeminfo.hot_tel)">
						<view class="titletext bold huang_text">热线电话</view>
						<view class="main_size bold hui_text">{{systeminfo.hot_tel}}</view>
					</view>
					<view class="flexbetween margin_top" style="width: 100%;">
						<view class="titletext bold huang_text">客服微信</view>
						<image :src="systeminfo.kf_wechat" @click="lbtpriview(systeminfo.kf_wechat)"
							style="width: 100rpx;height: 100rpx;" mode=""></image>
					</view>
				</view>
			</view>
		</u-popup>
	</view>
</template>

<script>
	const httpRequest = require("@/common/httpRequest.js")
	export default {
		name: "kefu",
		props: ["kefushow"],
		data() {
			return {
				systeminfo: {}
			};
		},
		created() {
			this.system()
		},
		methods: {
			phone(p) {
				uni.makePhoneCall({
					phoneNumber: p.toString()
				}).catch((e) => {
					// console.log(e)  //用catch(e)来捕获错误{makePhoneCall:fail cancel}
				})
			},
			lbtpriview(arr) {
				var i = [arr]; //获取当前页面的轮播图数据
				//uniapp预览轮播图
				uni.previewImage({
					current: 0, //预览图片的下标
					urls: i //预览图片的地址，必须要数组形式，如果不是数组形式就转换成数组形式就可以
				})
			},
			system() {
				httpRequest.request('index/getConfigInfo', 'GET', {}).then(res => {
					this.systeminfo = res.data
				})
			},
			closed() {
				this.$emit("closed")
			}
		}
	}
</script>

<style>

</style>